﻿using UnityEngine;
using System.Collections;

public class Pouso : MonoBehaviour 
{
	public GameObject Player;
	Animator anim;
	bool jumping;
	float timePouso;
	public bool pousando;
	// Use this for initialization
	void Start ()
	{
		anim = Player.GetComponent<Animator>();
	}
	
	// Update is called once per frame
	void Update ()
	{
		timePouso -= Time.deltaTime;
		jumping = Player.GetComponent<PlayerMoviment>().jumping;
		if(timePouso > 0)
		{
			pousando = true;
		}
		else{
			pousando = false;
		}
	
	}
	void OnTriggerEnter2D(Collider2D other)
	{
		if(other.gameObject.tag == "chao" && jumping)
		{
			timePouso = 0.5f;
		}
	}
}
